package com.marvels.system.permission.service;

import java.util.List;

import com.github.pagehelper.Page;
import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.system.common.dto.SysMenuDTO;
import com.marvels.system.permission.dto.SysRoleDTO;

/**
 * 
* @ClassName: SysRoleService 
* @Description:  系统角色服务类
* @author 李瑶
* @date 2018年1月24日 上午10:16:09 
*
 */
public interface SysRoleService {
	/**
	 * 角色分页查询
	 * @param conditions
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Page<SysRoleDTO> getRolePage(SysRoleDTO conditions,Integer pageNo,Integer pageSize)throws MarvelsBusinessException;
	
	/**
	 * 获取全部角色
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<SysRoleDTO> getAllRoles()throws MarvelsBusinessException;
	
	/**
	 * 获取角色详情
	 * @param role
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public SysRoleDTO getRoleById(SysRoleDTO role)throws MarvelsBusinessException;
	
	/**
	 * 新增角色
	 * @param sysrole
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public int addRole(SysRoleDTO sysrole)throws MarvelsBusinessException;
	
	/**
	 * 更新角色
	 * @param sysrole
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public int updateRole(SysRoleDTO sysrole)throws MarvelsBusinessException;
	
	/**
	 * 删除角色
	 * @param record
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public int deleteRole(SysRoleDTO record)throws MarvelsBusinessException;
	
	/**
	 * 添加角色和菜单关系
	 * @param record
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public int addMenuRelation(SysRoleDTO record)throws MarvelsBusinessException;
	
	/**查询角色，级联查询所属用户
	 * @author 何杰
	 * 2018年5月20日
	 * @param record
	 * @return;
	 * @throws MarvelsBusinessException
	 */
	public List<SysRoleDTO> getSysRolesByRoleCodes(List<String> roleCodes)throws MarvelsBusinessException;
	
	public List<SysRoleDTO> getAllSysRolesByRoleCodes(List<String> roleCodes) throws MarvelsBusinessException;
}
